package com.zero_x.dao.impl;

import com.zero_x.dao.SysUserMapper;
import com.zero_x.entity.Supplier;
import com.zero_x.entity.SysUser;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import java.util.List;

public class SysUserMapperImpl extends SqlSessionDaoSupport  implements SysUserMapper{
//    private SqlSessionTemplate sqlSession;

    @Override
    public List<SysUser> selectSysUserList(SysUser sysUser) {

        return this.getSqlSession().selectList("com.zero_x.dao.SysUserMapper.selectSysUserList",sysUser);

//        return sqlSession.selectList("selectSysUserList",sysUser);
    }

    @Override
    public int add(SysUser sysUser) {


        return this.getSqlSession().insert("com.zero_x.dao.SysUserMapper.add",sysUser);
    }

    @Override
    public List<Supplier> selectSupplier(Supplier supplier) {
        return this.getSqlSession().selectList("com.zero_x.dao.SysUserMapper.selectSupplier",supplier);
    }

    @Override
    public int SupplierAdd(Supplier supplier) {
        return this.getSqlSession().insert("com.zero_x.dao.SysUserMapper.SupplierAdd",supplier);
    }

    @Override
    public int SupplierDelete(Integer id) {
        return this.getSqlSession().delete("com.zero_x.dao.SysUserMapper.SupplierDelete",id);
    }

    @Override
    public int SupplierUpdate(Supplier supplier) {
        return this.getSqlSession().update("com.zero_x.dao.SysUserMapper.Supp;oerUpdate",supplier);
    }

//    public SqlSessionTemplate getSqlSession() {
//        return sqlSession;
//    }
//
//    public void setSqlSession(SqlSessionTemplate sqlSession) {
//        this.sqlSession = sqlSession;
//    }
}
